<%@ page import="com.atguigu.bean.User" %>
<%@ page import="java.util.HashMap" %>
<%@ page import="java.util.Map" %><%--
  Created by IntelliJ IDEA.
  User: zsh
  Date: 2020/9/10
  Time: 6:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    User user1 = new User(1001,"admin1","123","123@qq.com");
    User user2 = new User(1002,"admin2","123","123@qq.com");
    User user3 = new User(1003,"admin3","123","123@qq.com");
    Map<String, User> map = new HashMap<String,User>();
    map.put("id_1001",user1);
    map.put("id_1002",user2);
    map.put("id_1003",user3);

    pageContext.setAttribute("map",map);
%>
使用el：获取map中的数据 <br>
id:${pageScope.map.id_1001.id}<br>
username:${pageScope.map.id_1001.username}<br>
password:${pageScope.map["id_1001"]}<br>
pageContext:${pageScope.map.id_1001.email}<br>
</body>
</html>
